home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2005 November
/
WNnov2005.iso
/
Windows
/
Equipement
/
hMailServer
/
hMailServer-4.1-Build-136.exe
/
{app}
/
Addons
/
Squirrelmail Plugins
/
hmailserver_changepass
/
functions.php
next >
Wrap
PHP Script
|
2004-07-06
|
5KB
|
149 lines
<?php
// include compatibility plugin
//
if (defined('SM_PATH'))
include_once(SM_PATH . 'plugins/compatibility/functions.php');
else if (file_exists('../plugins/compatibility/functions.php'))
include_once('../plugins/compatibility/functions.php');
else if (file_exists('./plugins/compatibility/functions.php'))
include_once('./plugins/compatibility/functions.php');
function hmailserver_changepass_check_password_force_do() {
global $plugin_hmailserver_changepass;
// get global variables for versions of PHP < 4.1
//
if (!compatibility_check_php_version(4, 1)) {
global $HTTP_POST_VARS, $HTTP_SERVER_VARS;
$_POST = $HTTP_POST_VARS;
$_SERVER = $HTTP_SERVER_VARS;
}
// get flag that tells us if this is a password submission attempt...
//
if (isset($_POST['plugin_hmailserver_changepass']))
$plugin_hmailserver_changepass = $_POST['plugin_hmailserver_changepass'];
if (!isset($plugin_hmailserver_changepass))
return;
// go check password
//
if (compatibility_check_SM_version(1, 3))
include_once(SM_PATH . 'plugins/hmailserver_changepass/options.php');
else
include_once('../plugins/hmailserver_changepass/options.php');
// if we come back after no success, redirect to right main
//
$location = $_SERVER['PHP_SELF'];
$location = str_replace('webmail', 'right_main', $location);
header('Location: ' . $location);
exit(0);
}
function hmailserver_changepass_opt_do() {
global $optpage_blocks;
$optpage_blocks[] = array(
'name' => _("Change Password"),
'url' => '../plugins/hmailserver_changepass/options.php',
'desc' => _("Use this to change your email password."),
'js' => FALSE
);
}
// OK, so this is not what this is supposed to be
// used for(?), but I couldn't figure it out any
// other way -- the save_pref method below is not
// working anymore, especially after turning off
// register_globals
//
function hmailserver_changepass_optpage_loadinfo_do() {
global $optpage_name, $plugin_hmailserver_changepass;
// get global variables for versions of PHP < 4.1
//
if (!compatibility_check_php_version(4, 1)) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
}
if (isset($_POST['plugin_hmailserver_changepass']))
$plugin_hmailserver_changepass = $_POST['plugin_hmailserver_changepass'];
if (isset($_GET['plugin_hmailserver_changepass']))
$plugin_hmailserver_changepass = $_GET['plugin_hmailserver_changepass'];
if (isset($plugin_hmailserver_changepass))
if ($plugin_hmailserver_changepass)
$optpage_name = _("Password changed successfully.<br>Please use your new password to log in from now on.");
else
$optpage_name = _("Password change cancelled.<br>Your password has NOT been changed.");
}
// this is old school and doesn't work any more, especially
// with register_globals = Off...
//
function hmailserver_changepass_save_pref_do() {
global $plugin_hmailserver_changepass, $optmode;
// get global variables for versions of PHP < 4.1
//
if (!compatibility_check_php_version(4, 1)) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
}
// get flag that tells us if this is a password submission attempt...
//
if (isset($_GET['plugin_hmailserver_changepass']))
$plugin_hmailserver_changepass = $_GET['plugin_hmailserver_changepass'];
if (isset($_POST['plugin_hmailserver_changepass']))
$plugin_hmailserver_changepass = $_POST['plugin_hmailserver_changepass'];
if (!isset($plugin_hmailserver_changepass))
return;
$optmode = 'display';
if (!$plugin_hmailserver_changepass)
echo '<p align=center><b>' . _("Password change cancelled.") . ' ' . _("Your password has NOT been changed.") . '</b></p>';
else
echo '<p align=center><b>' . _("Password changed successfully.") . ' ' . _("Please use your new password to log in from now on.") . '</b></p>';
}
?>